<template>
    <view :style="{'--color': color}">
        <status-bar title=" " :back="type == 0 ? 1 : 0"></status-bar>
        <view v-if="type == '0'">
            <view class="padding30 text-center m-bot20">
                <text class="iconfont icon-success size100"></text>
                <view class="size30 size33 bold m-top30">提现申请成功</view>
                <view class="size42 color_FOD m-top10">￥{{ logInfo.applyMoney }}</view>
            </view>
            <view class="dest padding30 d-flex j-sb" v-if="logInfo.cash_method == 1">
                <view class="size32">收款卡号</view>
                <view class="size32">{{ logInfo.bankName }}（{{ logInfo.bankCard }}）</view>
            </view>
            <view class="dest padding30 d-flex j-sb" v-else>
                <view class="size32">收款账号</view>
                <view class="size32">{{ logInfo.cash_method == 4 ? '微信' : '支付宝' }}（{{ logInfo.bankCard }}）</view>
            </view>
            <view class="padding40">
                <view class="size30 m-bot30">提现状态</view>
                <u-steps current="0" direction="column" activeColor="#10995a" dot>
                    <u-steps-item title="提现申请已提交，等待处理。" :desc="logInfo.createDate"></u-steps-item>
                    <u-steps-item title="到账时间预计2工作日"></u-steps-item>
                </u-steps>
            </view>
            <view class="p-left40 p-right40" v-if="withdrawal_rules">
                <view class="size30 m-bot30">到账时间说明</view>
                <view class="h6 color_33 m-bot10" v-for="(item,index) in withdrawal_rules" :key="index">{{ item }}</view>
            </view>
            <view class="d-flex j-se m-top80">
                <view class="btn bgCC flexac size30 color_33" @click="backHome()">返回首页</view>
                <view class="btn thmeBg flexac size30 white" @click="back()">继续提现</view>
            </view>
        </view>

        <view v-if="type == 1 || type == 2">
            <view class="padding30 text-center m-bot20">
                <text class="iconfont icon-success size100"></text>
                <view class="size30 size33 bold m-top30">签约成功</view>
            </view>
            <view class="d-flex j-se m-top80">
                <view class="btn bgCC flexac size30 color_33" @click="backHome()">返回首页</view>
                <view class="btn thmeBg flexac size30 white" @click="toUrl('/joinPage/joinCenter')" v-if="type == 1">查看加盟</view>
                <view class="btn thmeBg flexac size30 white" @click="toUrl('/joinPage/crowdfunding')" v-if="type == 2">查看众筹</view>
            </view>
        </view>
    </view>
</template>

<script>
import {mapState} from 'vuex'
export default {
    data(){
        return {
            id: '',
            logInfo: '',
            withdrawal_rules: '',
            type: '' // 提现0、加盟1、众筹2
        }
    },
    computed: {
        ...mapState(['color'])
    },
    onLoad(e){
        if(e.id) this.id = e.id
        if(e.type) this.type = e.type
        if(this.type == 0) this.getInfo()
    },
    methods: {
        getInfo(){
            this.$http.post({
                url: '/singleSaleApi/getCommissionWithdrawalInfo',
                data: {
                    id: this.id
                }
            }).then(res=>{
                if(res.errcode != 100) return this.$Toast(res.msg)
                this.logInfo = res.data.logInfo
                this.withdrawal_rules = res.data.withdrawal_rules.split('\n')
            })
        }
    }
}
</script>

<style lang="scss" scoped>
.icon-success {
    color: $uni-color-success;
}
.dest {
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}
.btn {
    width: 260rpx;
    height: 80rpx;
    border-radius: 40rpx;
}
</style>